<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/artice_add.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css">
    <link rel="stylesheet" href="./cropper/cropper.css">
    <script src="../js/jquery.min.js"></script>
    <script src="../lib/layui/layui.all.js"></script>
    <script src="./js/article_add.js"></script>
    <script src="../lib/template-web.js"></script>
    <script src="./js/tinymce/tinymce.min.js"></script>
    <script src="./js/tinymce/tinymce_setup.js"></script>
    <script src="./cropper/Cropper.js"></script>
    <script src="./cropper/jquery-cropper.js"></script>
</head>

<body>
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">基本信息</li>
            <li>文章正文</li>
            <li>关键字描述</li>
        </ul>
        <!-- 第一页 -->
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form" id="form-pub">
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">文章分类</label>
                        <div class="layui-input-block">
                            <select name="catename" lay-verify="required">
                        </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章作者</label>
                        <div class="layui-input-block">
                            <input type="text" name="author" required lay-verify="required" placeholder="请输入作者" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">标签</label>
                        <div class="layui-input-block">
                            <input type="text" name="tags" required lay-verify="required" placeholder="请输入标签" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">阅读次数</label>
                        <div class="layui-input-block">
                            <input type="text" name="click" required placeholder="阅读次数" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否推荐</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="switch" lay-skin="switch">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <!-- 左侧的 label -->
                        <label class="layui-form-label">文章封面</label>
                        <!-- 选择封面区域 -->
                        <div class="layui-input-block cover-box">
                            <!-- 左侧裁剪区域 -->
                            <div class="cover-left">
                                <img id="image" src="https://img1.baidu.com/it/u=2151419446,3612789904&fm=26&fmt=auto&gp=0.jpg" alt="" />
                            </div>
                            <!-- 右侧预览区域和选择封面区域 -->
                            <div class="cover-right">
                                <!-- 预览的区域 -->
                                <div class="img-preview"></div>
                                <!-- 选择封面按钮 -->
                                <button type="button" class="layui-btn layui-btn-danger" id="btnChooseImage">选择封面</button>
                                <input type="file" id="coverFile" style="display: none;" accept="image/png,image/jpeg,image/gif" />
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>发布</button>
                            <button class="layui-btn layui-btn-primary" lay-submit id="btnSave2">存为草稿</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>

            </div>
            <!-- 第二页 -->
            <div class="layui-tab-item">
                <div class="layui-form-item">
                    <!-- 左侧的 label -->
                    <label class="layui-form-label">文章内容</label>
                    <!-- 为富文本编辑器外部的容器设置高度 -->
                    <div class="layui-input-block" style="height: 400px;">
                        <!-- 重要：将来这个 textarea 会被初始化为富文本编辑器 -->
                        <textarea name="content" lay-verify="required"></textarea>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>发布</button>
                            <button class="layui-btn layui-btn-primary" lay-submit id="btnSave2">存为草稿</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>

                </div>
            </div>
            <!-- 第三页 -->
            <div class="layui-tab-item">

                <div class="layui-form-item">
                    <label class="layui-form-label">关键字</label>
                    <div class="layui-input-block">
                        <input type="text" name="keywords" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                    </div>
                    <div>
                        <i class="ss">描述</i>
                        <div class="discrip">文章描述</div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit>发布</button>
                        <button class="layui-btn layui-btn-primary" lay-submit id="btnSave2">存为草稿</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>

            </div>
            </form>
        </div>
    </div>
    <!-- 下拉列表区域模板字符串 -->
    <script type="text/html" id="tpl-cate">
        <option value="">所有分类</option>
        {{each data}}
        <option value="{{$value.id}}">{{$value.catename}}</option>
        {{/each}}
    </script>
</body>

</html>